﻿using System;
using System.ComponentModel.DataAnnotations;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var dearTime = DateTime.Now;
            Console.WriteLine("现在是北京时间" + dearTime.ToString("yyyy-MM-dd hh:mm:ss"));
            var Day = "2020-5-26";
            var d = Convert.ToDateTime(Day);
            var chinaDay = "1949-10-1";
            var cd = Convert.ToDateTime(chinaDay);
            var td = d - cd;
            Console.WriteLine("中国已经成立" + td + "天了");


            var dda = "我爱你，中国.";

            var lon = dda.IndexOf("国");
            Console.WriteLine(lon);
            Console.WriteLine(dda.LastIndexOf('你'));



            for (int i = 0; i< dda.Length; i++)
            {
                Console.WriteLine(dda[i]);
            }


            var two = "2020-06-01";

            var one = Convert.ToDateTime(two);

            var three = one.AddDays(-1);
            Console.WriteLine(three);
        } 
    }
}
